﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	测压井测压仪
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul class="top_tab">
	            <li><a href="/Stack/Index"><span>堆场管理</span></a></li>
                <li><a href="/Stack/Edit/<%=ViewData["id"] %>"><span>基本信息</span></a></li>
                <li><a href="/Stack/Weather/<%=ViewData["id"] %>"><span>气象信息</span></a></li>
                <li><a href="/Stack/Stack/<%=ViewData["id"] %>"><span>堆场信息</span></a></li>
                <li><a href="/Stack/Pool/<%=ViewData["id"] %>t"><span>调节水池</span></a></li>
                <li><a href="/Stack/Material/<%=ViewData["id"] %>"><span>材料信息</span></a></li>
                <li><a href="/Stack/Settle/<%=ViewData["id"] %>"><span>沉降模型</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>测压井测压仪</span></a></li>
                <li><a href="/Stack/Drain/<%=ViewData["id"] %>"><span>导渗系统</span></a></li>
                <li><a href="/Position/List?type=1&stackId=<%=ViewData["id"] %>"><span>上传图片</span></a></li>
	        </ul>
	    </div>
	</div>

    
    <% 
    Piezometer_well_base_info[] wells = (Piezometer_well_base_info[])ViewData["wells"];
    Piezometer_base_info[] topEquaps = (Piezometer_base_info[])ViewData["topEquaps"];
    Piezometer_base_info[] bottomEquaps = (Piezometer_base_info[])ViewData["bottomEquaps"];
    int wellNum = wells.Length;
    int equapNum = topEquaps.Length;

    using (Html.BeginForm("Piezometer", "Stack", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
    %>
        <%= Html.ValidationSummary(true) %>
        <%= Html.Hidden("id", (int)ViewData["id"])%>
        <%
           bool result = (bool)ViewData["success"];
           if(result){ 
        %>
           <div class="tips_area">测压井测压仪更新成功</div>
        <%
        }
        %>

    <fieldset class="tf_style">
        <legend>测压井</legend>

        <div id="wells">
            <%
            int i = 0;
            foreach (Piezometer_well_base_info well in wells)
            {
            %>

            <table id="well<%=i + 1 %>" cellpadding="4" cellspacing="0" class="com_detail_table2" style="margin-top:8px;">
                <tr>
                    <td style="width:120px; text-align:center;"><strong><%= i + 1 %>号测压井</strong></td>
                    <td class="lab" style="width:80px;">孔顶标高</td>
                    <td style="width:80px;"><%= Html.TextBox("well_top_El" + (i + 1), well.well_top_El, new { size = "6" })%></td>
                    <td class="lab" style="width:80px;">孔底标高</td>
                    <td><%= Html.TextBox("Well_bottom_El" + (i + 1), well.Well_bottom_El, new { size = "6" })%></td>
                    <td style="width:60px;"><%if (i > 0) { %><a class="a_color39f" style='float:right; margin-right:8px;' href="javascript:void(0);" onclick="removeWell(<%=i + 1 %>);">X</a><%} %></td>
                </tr>
            </table>

            <%
                i++;
            }
            %>
        </div>

        <p><input type="button" value="增加测压井" onclick="addWell();" /></p>

        <div style="margin-left:18px;margin-top:10px;">测压井位置图片：<input type="file" name="piezometerWellPic" size="68" /><%if(!string.IsNullOrEmpty((string)ViewData["piezometerWellPic"])) {%> <label class="icon_12"><a href="<%=Url.Content((string)ViewData["piezometerWellPic"]) %>" target="_blank">查看原图</a></label><%} %></div>
    </fieldset>
    
        
    
    <fieldset class="tf_style">
        <legend>测压仪</legend>

        <div id="equaps">
            <%
            i = 0;
            for (;i < topEquaps.Length;)
            {
            %>

               <table id="equap<%=i + 1 %>" cellpadding="4" cellspacing="0" class="com_detail_table2" style="margin-top:8px; text-align:center;">
                   <tr>
                       <th colspan="8">测压孔编号：<%= i + 1 %><%if (i > 0) { %> <a class="a_color39f" style='float:right; margin-right:8px;' href="javascript:void(0);" onclick="removeEquap(<%=i + 1 %>);">X</a><%} %></th>
                   </tr>
                   <tr>
                       <td style="width:60px; text-align:center;">&nbsp;</td>
                       <td style="text-align:center;">编号</td>
                       <td style="text-align:center;">安装深度</td>
                       <td style="text-align:center;">感应器底标高</td>
                       <td style="text-align:center;">模数系数</td>
                       <td style="text-align:center;">初始模数</td>
                       <td style="text-align:center;">温度系数</td>
                       <td style="text-align:center;">初始温度</td>
                   </tr>
                   <tr>
                       <td>高位</td>
                       <td><%= Html.TextBox("piezometer_name_1_" + (i + 1), topEquaps[i].piezometer_name, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Installation_depth_1_" + (i + 1), topEquaps[i].Installation_depth, new { size = "6" })%></td>
                       <td><%= Html.TextBox("piezometer_bottom_El_1_" + (i + 1), topEquaps[i].piezometer_bottom_El, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Modulus_coefficient_1_" + (i + 1), topEquaps[i].Modulus_coefficient, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Initial_Modulus_1_" + (i + 1), topEquaps[i].Initial_Modulus, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Temperature_coefficient_1_" + (i + 1), topEquaps[i].Temperature_coefficient, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Initial_temperature_1_" + (i + 1), topEquaps[i].Initial_temperature, new { size = "6" })%></td>
                   </tr>
                   <tr>
                       <td>低位</td>
                       <td><%= Html.TextBox("piezometer_name_2_" + (i + 1), bottomEquaps[i].piezometer_name, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Installation_depth_2_" + (i + 1), bottomEquaps[i].Installation_depth, new { size = "6" })%></td>
                       <td><%= Html.TextBox("piezometer_bottom_El_2_" + (i + 1), bottomEquaps[i].piezometer_bottom_El, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Modulus_coefficient_2_" + (i + 1), bottomEquaps[i].Modulus_coefficient, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Initial_Modulus_2_" + (i + 1), bottomEquaps[i].Initial_Modulus, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Temperature_coefficient_2_" + (i + 1), bottomEquaps[i].Temperature_coefficient, new { size = "6" })%></td>
                       <td><%= Html.TextBox("Initial_temperature_2_" + (i + 1), bottomEquaps[i].Initial_temperature, new { size = "6" })%></td>
                    </tr>
               </table>

            <%
                i++;
            }
            %>
        </div>

        <p><input type="button" value="增加测压仪" onclick="addEquap();" /></p>

        <div style="margin-left:18px;margin-top:10px;">测压仪位置图片：<input type="file" name="piezometerEquapPic" size="68" /><%if (!string.IsNullOrEmpty((string)ViewData["piezometerEquapPic"])){%> <label class="icon_12"><a href="<%=Url.Content((string)ViewData["piezometerEquapPic"]) %>" target="_blank">查看原图</a></label><%} %></div>

    </fieldset>
 
    <div class="submit_btn_area" style="margin-left:142px;">
        <%= Html.Hidden("totalWellNum", wellNum)%>
        <%= Html.Hidden("totalEquapNum", equapNum)%>
        <input type="submit" value="提 交" />
    </div>
    <% } %>

    <script type="text/javascript"" language="javascript">
        var wellNum = <%= wellNum%>;
        function getInnerHtml(wellNo)
        {
            var htmlStr = "<table id='well" + wellNo + "' cellpadding='4' cellspacing='0' class='com_detail_table2' style='margin-top:8px;'><tr><td style='width:120px; text-align:center;'><strong>" + wellNo + "号测压井</strong></td><td class='lab' style='width:80px;'>孔顶标高</td><td style='width:80px;'><input size='6' type='text' name='well_top_El" + wellNo + "' value='' /></td><td class='lab' style='width:80px;'>孔底标高</td><td><input size='6' type='text' name='Well_bottom_El" + wellNo + "' value='' /></td><td style='width:60px;'><a class='a_color39f' style='float:right; margin-right:8px;' href='javascript:void(0);' onclick='removeWell(" + wellNo + ");'>X</a></td></tr></table>";

	        return htmlStr;
        }        
        
        function addWell() {
            wellNum++;
            $("#wells").append(getInnerHtml(wellNum));
            document.getElementById("totalWellNum").value = wellNum;
        }

        function removeWell(wellNo) {
            wellNum--;
            $("#well" + wellNo).remove();
            document.getElementById("totalWellNum").value = wellNum;
        }

        var equapNum = <%= equapNum%>;
        function getEquapInnerHtml(equapNo)
        {
            var htmlStr = "<table id='equap" + equapNo +"' cellpadding='4' cellspacing='0' class='com_detail_table2' style='margin-top:8px; text-align:center;'><tr><th colspan='8'>测压孔编号：" + equapNo +" <a class='a_color39f' style='float:right; margin-right:8px;' href='javascript:void(0);' onclick='removeEquap(" + equapNo +");'>X</a></th></tr><tr><td style='width:60px; text-align:center;'>&nbsp;</td><td style='text-align:center;'>编号</td><td style='text-align:center;'>安装深度</td><td style='text-align:center;'>感应器底标高</td><td style='text-align:center;'>模数系数</td><td style='text-align:center;'>初始模数</td><td style='text-align:center;'>温度系数</td><td style='text-align:center;'>初始温度</td></tr><tr><td>高位</td><td><input size='6' type='text' name='piezometer_name_1_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Installation_depth_1_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='piezometer_bottom_El_1_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Modulus_coefficient_1_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Initial_Modulus_1_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Temperature_coefficient_1_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Initial_temperature_1_' + " + equapNo +" value='' /></td></tr><tr><td>低位</td><td><input size='6' type='text' name='piezometer_name_2_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Installation_depth_2_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='piezometer_bottom_El_2_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Modulus_coefficient_2_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Initial_Modulus_2_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Temperature_coefficient_2_' + " + equapNo +" value='' /></td><td><input size='6' type='text' name='Initial_temperature_2_' + " + equapNo +" value='' /></td></tr></table>";
	        return htmlStr;
        }        
        
        function addEquap() {
            equapNum++;
            $("#equaps").append(getEquapInnerHtml(equapNum));
            document.getElementById("totalEquapNum").value = equapNum;
        }

        function removeEquap(equapNo) {
            equapNum--;
            $("#equap" + equapNo).remove();
            document.getElementById("totalEquapNum").value = equapNum;
        }
    </script>
</asp:Content>
